﻿<UserControl x:Class="TicketServer.TicketStatusControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:a="clr-namespace:TicketServer.Interfaces.Attributes;assembly=TicketServer.Interfaces"
             xmlns:c="clr-namespace:TicketServer.Common;assembly=TicketServer.Common"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:i="clr-namespace:TicketServer.Interfaces.Enums;assembly=TicketServer.Interfaces"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             d:DesignWidth="500"
             mc:Ignorable="d">
	<UserControl.Resources>
		<a:EnumToFriendlyNameConverter x:Key="enumItemsConverter" />
		<c:Code39ValueConverter x:Key="code39Converter" />
		<c:BoolToVisibilityConverter x:Key="boolToVisibilityConverter" />
	</UserControl.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="100" />
			<ColumnDefinition />
			<ColumnDefinition Width="100" />
			<ColumnDefinition />
			<ColumnDefinition Width="*" />
			<ColumnDefinition />
		</Grid.ColumnDefinitions>

		<Grid.RowDefinitions>
			<RowDefinition Height="18" />
			<RowDefinition Height="18" />
			<RowDefinition Height="18" />
			<RowDefinition Height="18" />
			<RowDefinition Height="18" />
			<RowDefinition Height="18" />
		</Grid.RowDefinitions>

		<TextBlock Grid.Row="0"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextId}" />
		<TextBlock Grid.Row="0"
		           Grid.Column="1"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Id}" />

		<TextBlock Grid.Row="0"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextCode}" />
		<TextBlock Grid.Row="0"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Code,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="1"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextName}" />
		<TextBlock Grid.Row="1"
		           Grid.Column="1"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Name,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="1"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextStreet}" />
		<TextBlock Grid.Row="1"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Street,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="2"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextZip}" />
		<TextBlock Grid.Row="2"
		           Grid.Column="1"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Zip,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="2"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextCity}" />
		<TextBlock Grid.Row="2"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.City,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="3"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextPhone}" />
		<TextBlock Grid.Row="3"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Phone,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="3"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextMail}" />
		<TextBlock Grid.Row="3"
		           Grid.Column="1"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.EMail,
		                          Mode=OneWay}" />

		<TextBlock Grid.Row="4"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextRedeemed}" />
		<CheckBox x:Name="checkBoxRedeemed"
		          Grid.Row="4"
		          Grid.Column="1"
		          Margin="5 0 0 0"
		          VerticalAlignment="Center"
		          IsChecked="{Binding Ticket.IsRedeemed,
		                              Mode=OneWay}"
		          IsEnabled="False" />

		<TextBlock Grid.Row="4"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextRedeemDate}" />
		<TextBlock Grid.Row="4"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.RedeemDate,
		                          Mode=OneWay,
		                          StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" />

		<TextBlock Grid.Row="5"
		           Grid.Column="0"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextOnline}" />
		<CheckBox x:Name="checkBoxOnline"
		          Grid.Row="5"
		          Grid.Column="1"
		          Margin="5 0 0 0"
		          VerticalAlignment="Center"
		          IsChecked="{Binding Ticket.IsOnlineTicket,
		                              Mode=OneWay}"
		          IsEnabled="False" />

		<TextBlock Grid.Row="5"
		           Grid.Column="2"
		           HorizontalAlignment="Right"
		           VerticalAlignment="Center"
		           Text="{LocText TicketServer:Ticket:TextType}" />
		<TextBlock Grid.Row="5"
		           Grid.Column="3"
		           Margin="3 0 0 0"
		           HorizontalAlignment="Left"
		           VerticalAlignment="Center"
		           FontWeight="Bold"
		           Text="{Binding Ticket.Type,
		                          Mode=OneWay,
		                          Converter={StaticResource enumItemsConverter}}" />

		<TextBlock Grid.Row="0"
		           Grid.RowSpan="6"
		           Grid.Column="4"
		           Margin="15 0"
		           HorizontalAlignment="Center"
		           VerticalAlignment="Center"
		           FontFamily="C39HrP48DhTt"
		           FontSize="100"
		           SnapsToDevicePixels="True"
		           Text="{Binding Ticket.Code,
		                          Converter={StaticResource ResourceKey=code39Converter}}" />

		<Image Grid.Row="0"
		       Grid.RowSpan="6"
		       Grid.Column="5"
		       Source="Icons\XLarge\clean.png"
		       Visibility="{Binding Ticket.IsRedeemed,
		                            Converter={StaticResource ResourceKey=boolToVisibilityConverter}}" />
	</Grid>
</UserControl>
